<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{$siteTitle}></title>
<link href="__PUBLIC__/admin/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/wx/js/jquery.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/wx/js/ecmall.js" charset="utf-8"></script>
<script type="text/javascript" src="__PUBLIC__/admin/wx/js/admin.js" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});
  

  
  
});


</script>
</head>
<body>
	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">微信用户列表</a></li>
    </ul>
    </div>
    <div class="rightinfo">
    	

     <fieldset style="border: 1px solid silver; margin-bottom: 20px;">
    	<legend style="margin-left: 10px; font-size: 14px; color: #009FDE; font-weight: bold;">查询</legend>
	    <div id="search_custom" >
		    <form action="<{:U('WxUser/index')}>" method="get" >
			    <ul class="seachform" style="margin: 10px 0px 0px 10px;">			    	
				    <li><label>微信昵称：</label><input name="wx_nickname" id="wx_nickname" type="text" class="scinput" value="<{$wx_nickname}>" /></li>
				   <li><label>微信openid：</label><input name="openid" id="openid" type="text" class="scinput" value="<{$openid}>" /></li>
<!-- 				    <li><label>国家：</label><input name="wx_country" id="wx_country" type="text" class="scinput" value="<{$wx_country}>" /></li> -->
<!-- 				    <li><label>省份：</label><input name="wx_province" id="wx_province" type="text" class="scinput" value="<{$wx_province}>" /></li> -->
<!-- 				    <li><label>城市：</label><input name="wx_city" id="wx_city" type="text" class="scinput" value="<{$wx_city}>" /></li> -->
				    <li><label>绑定手机号：</label><input name="bindingPhone" id="bindingPhone" type="text" class="scinput" value="<{$bindingPhone}>" /></li>
				    <li><label>绑定姓名：</label><input name="bindingName" id="bindingName" type="text" class="scinput" value="<{$bindingName}>" /></li>
				    <li><label>车牌：</label><input name="carNO" id="carNO" type="text" class="scinput" value="<{$carNO}>" /></li>
				    <li><label>客户等级:</label>
					    <select name="levelID" style="border: solid 1px #a7b5bc; height: 32px;width: 100px;">
					    	<option value ="" <if condition="$levelID eq ''">selected="selected"</if>>所有</option> 
					    	<option value ="普通客户" <if condition="$levelID eq '普通客户'">selected="selected"</if>>普通客户</option>
					    	<option value ="金牌客户" <if condition="$levelID eq '金牌客户'">selected="selected"</if>>金牌客户</option>
					    	<option value ="钻石客户" <if condition="$levelID eq '钻石客户'">selected="selected"</if>>钻石客户</option>
					    	<option value ="新客户" <if condition="$levelID eq '新客户'">selected="selected"</if>>新客户</option>
					    	    
						</select>
					</li>
				    <li><label>性别:</label>
					    <select name="wx_sex" style="border: solid 1px #a7b5bc; height: 32px;width: 60px;">
					    	<option value ="all" <if condition="$wx_sex eq '3'">selected="selected"</if>>所有</option> 
					    	<option value ="1" <if condition="$wx_sex eq 1">selected="selected"</if>>男</option>
					    	<option value ="2" <if condition="$wx_sex eq 2">selected="selected"</if>>女</option>
					    	    
						</select>
					</li>
					<li><label>分店</label>
					    <select name="queryCompCode" style="border: solid 1px #a7b5bc; height: 32px;width: 150px;">
					    	<option value ="all" <if condition="$queryCompCode eq 'all'">selected="selected"</if>>所有</option> 
					    	<foreach name="allStoreArr" item="one" key="k1">
					    		<option value ="<{$one.compCode}>" <if condition="$one['compCode'] eq $queryCompCode">selected="selected"</if>><{$one.compName}></option>
					    	</foreach>    
						</select>
					</li>
					<li><label>区域</label>
					    <select name="areaName" style="border: solid 1px #a7b5bc; height: 32px;width: 150px;">
					    	<option value ="all" <if condition="$areaName eq 'all'">selected="selected"</if>>所有</option> 
					    	<foreach name="areaArr" item="one" key="k1">
					    		<option value ="<{$one.areaName}>" <if condition="$one['areaName'] eq $areaName">selected="selected"</if>><{$one.areaName}></option>
					    	</foreach>    
						</select>
					</li>
					
				    <li><label>&nbsp;</label><input name="" type="submit" class="scbtn" value="查询"/></li>
			    </ul>
			</form>
	    </div>
    </fieldset>
    
    <table class="tablelist">
    	<thead>
	    	<tr>
<!-- 	    		<th><input name="" type="checkbox" class="checkall"/></th> -->
				<th>id</th>
	    		<th style="max-width: 210px;">openid</th>
		        <th style="max-width: 100px;">微信昵称</th>
		        <th >性别</th>
		        <th style="max-width: 100px;">绑定的姓名</th>
		        <th>绑定的手机</th>
		        <th>分店</th>
		        <th>区域</th>
		        <th>车牌</th>
		        <th >预约次数</th>
		        <th>客户等级</th>
<!-- 		        <th>国家</th> -->
<!-- 		        <th>省份</th> -->
<!-- 		        <th>市</th> -->
		        <th>头像</th>
		        <th>操作</th>
	        </tr>
        </thead>
        <tbody>
        <foreach name="pageList" item="one_wx_user">
	        <tr>
<!-- 	        	<td><input name="" type="checkbox"  class="checkitem"/></td> -->
				<td><{$one_wx_user.id}></td>
		        <td style="max-width: 210px;"><{$one_wx_user.openid}></td>
		        <td style="max-width: 100px;"><{$one_wx_user.wx_nickname}></td>
		        <td><if condition="$one_wx_user['wx_sex'] eq 1">男<elseif condition="$one_wx_user['wx_sex'] eq 2" />女<else/>未知</if></td>
		        <td style="max-width: 100px;"><{$one_wx_user.bindingName}></td>
		        <td><{$one_wx_user.bindingPhone}></td>
		        <td><{$one_wx_user.compName}></td>
		        <td><{$one_wx_user.areaName}></td>
		        <td>
		        	<table  bordercolor=#ccffcc width=100%>
			        	<foreach name="one_wx_user.carNO" item="one_car">
			        		<tr><td><a href="<{:U('userAllCar',array('clientCode'=>$one_wx_user['clientCode']))}>"><{$one_car}></a></td></tr>
			        	</foreach> 
				      
				    </table>
		        	
		        </td>
		        <td ><{$one_wx_user.orderCount}></td>
		         
		        
		        <td><{$one_wx_user.levelID}></td>
<!-- 		        <td><{$one_wx_user.wx_country}></td> -->
<!-- 		        <td><{$one_wx_user.wx_province}></td> -->
<!-- 		        <td><{$one_wx_user.wx_city}></td> -->
		        <td>
		        	<if condition="$one_wx_user.wx_photo eq ''">
		        		
		        	<else/>
		        		<a href="<{$one_wx_user.wx_photo}>" target="_blank"><img src="<{$one_wx_user.wx_photo}>" style="width: 30px; height: 30px; padding-top: 10px; padding-bottom: 10px;"/></a>
		        	</if>
		       </td>
		       <td>
		        	<a href="<{:U('detail',array('id'=>$one_wx_user['id']))}>">详细</a>|
		        	<a href="javascript:void(0);" onclick="delWxUser('<{:U(\'ajaxDel\',array(\'id\'=>$one_wx_user[\'id\']))}>')">删除</a> 
		       </td>
		       
	        </tr>
	    </foreach> 
        </tbody>
    </table>
    <div class="pagin" style="margin-bottom: 30px;">
<!--     	<div class="message">共<i class="blue"><{$article_total}></i>条记录，当前显示第&nbsp;<i class="blue"><{$page_now}>&nbsp;</i>页</div> -->
       	<{$page}>
    </div>
    
    </div>
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	
function delWxUser(url){
		
		if(confirm("您确认删除吗？")){
			
			$.ajax({
				url : url,
				type:"GET",
				//cache : false,
				dataType : 'json',
				data : null,
				success : function(result) {
					
					
					if(result == 1){
						alert('删除成功！');
						window.location.href=window.location.href; 
						window.location.reload;
					}else{
						alert('删除失败！');
					}
					
					
					
					
				},error:function(xhr){
					alert("网络出错，请刷新页面！");
				}
			});
		}
	}
	</script>
</body>
</html>
